package cn.iocoder.yudao.module.engine.model.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Component
@ConfigurationProperties(prefix = "engine")
@Data
public class EngineConfig {
    private AudioQueueConfig audioQueue;
    private Integer historyMessageMaxSize;
    private Boolean mock = false;
    private ThreadPool threadPool = new ThreadPool();
    private Boolean disableLock = false;

    // 购买引导最大次数
    private Integer buyGuideTriggerMaxCount = 3;

    @Data
    public static class AudioQueueConfig {
        private String primary;
    }

    @Data
    public static class ThreadPool {
        private Integer llmSemaphoreSize = 2;
        private Integer ttsSemaphoreSize = 3;

        private Integer llmCorePoolSize = Runtime.getRuntime().availableProcessors() * 50;

        private Integer ttsCorePoolSize = Runtime.getRuntime().availableProcessors() * 50;

        private Integer messageSaveCorePoolSize = Runtime.getRuntime().availableProcessors() * 2;

        private Integer engineTimerCorePoolSize = Runtime.getRuntime().availableProcessors() * 4;
    }

    public static void main(String[] args) {
        System.out.println(Integer.MAX_VALUE);
    }

}
